#include "matrixfunctions.h"

void descsort(int x[][100], int row, int col, int column)
{
	int i, j, k=column, aux, aux2, l;
	for (i=1; i<row; i++){
		aux=x[i][k];
		l=i-1;
		while (aux>x[l][k] && l>=0){
			for(j=0; j<col; ++j){
				aux2=x[l+1][j];
				x[l+1][j]=x[l][j];
				x[l][j]=aux2;
			}
			--l;
		}
	}
			
}

int main()
{
	int row, col, k;
	int mat[100][100];
	cout<<"Number of rows : ";
	cin>>row;
	cout<<"Number of columns : ";
	cin>>col;
	readmatrix(mat, row, col);
	cout<<"Column k : ";
	cin>>k;
	descsort(mat, row, col, k);
	printmatrix(mat, row, col);
	
	
return 0;
}
